Skip to content

Update go.yml - #18

Merged
franchb merged 4 commits into
masterfrom
franchb-patch-1
Nov 6, 2025
Merged

Update go.yml#18
franchb merged 4 commits into
masterfrom
franchb-patch-1

Conversation

@franchb

@franchb franchb commented Nov 6, 2025

Copy link
Copy Markdown
Collaborator

Set Go version to 1.25.3

Summary by CodeRabbit

  • Chores

    • Updated Go toolchain, CI workflows, linters (including golangci-lint v2 and new lint flags), linter configuration, and numerous module dependency versions.
  • Refactor

    • Removed "migrate" and "update" CLI commands and their flows.
    • Modernized build tag syntax and small internal code cleanups.
  • Security

    • Enforced minimum TLS versions (server >=1.2; several clients >=1.3) and stricter certificate file permissions (0600).

Set Go version to 1.25.3

Signed-off-by: Eliah Rusin <hello@franchb.com>
@franchb franchb self-assigned this Nov 6, 2025
@coderabbitai

coderabbitai Bot commented Nov 6, 2025

Copy link
Copy Markdown

Walkthrough

Bumped Go/tooling versions in CI, reworked golangci-lint, updated many module dependencies, removed the migrate and update CLI commands, tightened TLS minimum versions in server/keystore components, and applied small refactors (explicit returns, formatting, API-client call adjustments).

Changes

Cohort / File(s) Summary
CI: workflows
​.github/workflows/go.yml, ​.github/workflows/release.yml
Updated Go toolchain to 1.25.3 (various steps); upgraded golangci-lint to v2.6.0 and added --tests=false argument.
Linter config
.golangci.yml
Reworked config to version: "2", replaced disable-all with explicit enabled linters, added formatters (gofumpt, goimports), new linters (misspell, prealloc, revive, staticcheck), and expanded path/message excludes.
Dependencies
go.mod
Bumped many dependency versions across cloud SDKs, golang.org/x/* modules, AWS/Azure/GCP libs, Prometheus, Vault, and other indirects.
CLI: removed commands
cmd/kes/migrate.go, cmd/kes/update.go
Deleted full implementations of the migrate and update commands (flags, network flows, migration/update logic, verification and progress reporting).
CLI: kes command changes
cmd/kes/main.go, cmd/kes/identity.go, cmd/kes/autocomplete.go
Removed migrate/update from registry and help; hard-coded TLS InsecureSkipVerify = false; replaced sdk alias with direct kes references; converted some naked returns to explicit returns.
TLS hardening
server.go, kesconf/file.go, internal/keystore/fortanix/keystore.go, internal/keystore/gemalto/key-secure.go, ...
Enforced minimum TLS versions: server listener now MinVersion TLS1.2; several keystore/Entrust/Gemalto/CA paths set MinVersion TLS1.3 when CAPath present.
Azure keystore fixes
internal/keystore/azure/client.go, internal/keystore/azure/key-vault.go
Iterate/read from page.Value (and check len(page.Value)) instead of page.SecretPropertiesListResult.Value.
Vault client refactor
internal/keystore/vault/vault.go
Switched from s.client.Client.* helpers to s.client.* higher-level methods for request creation/execution.
Minor refactors / formatting / explicit returns
internal/cache/cow.go, internal/api/api.go, internal/keystore/aws/secrets-manager.go, kesconf/config.go, cmd/kes/mlock_ref.go, internal/fips/*
Small changes: explicit named returns instead of naked returns, De Morgan rewrite in a condition, signature/line-break formatting, YAML reindent, modernized build tags, and trivial formatting edits.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant User
    participant kesCLI as kes (CLI)
    participant Server

    Note over kesCLI: Before change (previous commit)
    User->>kesCLI: run "kes migrate" or "kes update"
    kesCLI->>Server: connect / perform migration/update flows
    Server-->>kesCLI: respond
    kesCLI-->>User: report progress / result

    Note over kesCLI: After change (this PR)
    User->>kesCLI: run "kes migrate" or "kes update"
    kesCLI-->>User: "unknown command" (commands removed)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Areas needing extra attention:
    • Full removals: cmd/kes/migrate.go, cmd/kes/update.go — check docs, release notes, CI/deployment scripts, and any callers or references.
    • TLS MinVersion changes: server.go, keystore clients, Entrust/CA paths — verify compatibility with supported clients/environments and tests for TLS connectivity.
    • .golangci.yml additions and --tests=false: ensure CI passes and new linters/excludes behave as intended.
    • go.mod bumps: run full test suite and vet for subtle API changes in updated dependencies.

Possibly related PRs

Poem

🐰 I hopped through diffs at break of day,
Removed two commands and chased old flags away.
TLS grown stronger, linters tuned anew,
Modules upgraded — pipelines fresh as dew.
I nibble commit carrots, then bound off to play 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The PR title 'Update go.yml' is vague and does not clearly convey the primary change. While it mentions updating a workflow file, it doesn't specify what was actually changed (Go version bump, linter updates, etc.). Use a more specific title like 'Upgrade Go to 1.25.3 and update CI tooling' or 'Bump Go version to 1.25.3 in workflows and linters' to clearly communicate the main changes.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch franchb-patch-1

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 468e14e and 2ed40e1.

📒 Files selected for processing (3)
  • cmd/kes/mlock_ref.go (0 hunks)
  • internal/fips/fips.go (0 hunks)
  • internal/fips/nofips.go (0 hunks)
💤 Files with no reviewable changes (3)
  • cmd/kes/mlock_ref.go
  • internal/fips/fips.go
  • internal/fips/nofips.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Test ubuntu-latest
  • GitHub Check: Test macos-latest
  • GitHub Check: Test windows-latest

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
.github/workflows/go.yml (1)

19-19: Consider upgrading to Go 1.25.4 for the latest patch fixes.

Go 1.25.3 (released 2025-10-13) includes fixes to the crypto/x509 package, while go1.25.4 (released 2025-11-05) includes fixes to the compiler, the runtime, and the crypto/subtle, encoding/pem, net/url, and os packages. Since 1.25.4 was just released, upgrading would ensure the latest stability improvements across more packages.

Also applies to: 34-34, 54-54, 71-71

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8a9ed44 and a85024d.

📒 Files selected for processing (1)
  • .github/workflows/go.yml (4 hunks)
🔇 Additional comments (1)
.github/workflows/go.yml (1)

41-41: ⚠️ Validate golangci-lint v2 configuration compatibility before merging.

golangci-lint v2 focuses on structural configuration changes and default values changes, including a new fmt command, new linter configuration (and default set of linters), and new default exclusion configuration. Upgrading from v1.64.5 to v2.6.0 is a major version bump with breaking changes. Ensure the .golangci.yml configuration file (referenced on line 42) is compatible with v2 defaults and structure before deploying.

Verify configuration compatibility by:

  1. Checking if .golangci.yml exists in the repository
  2. Confirming it's compatible with golangci-lint v2 structure
  3. Running the workflow locally or in a test environment to validate linting passes

Signed-off-by: Eliah Rusin <hello@franchb.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a85024d and 5eed726.

📒 Files selected for processing (1)
  • .github/workflows/release.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build

uses: actions/setup-go@v6
with:
go-version: 1.24.0
go-version: 1.25.3

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify Go 1.25.3 is a valid release and all workflows are consistently updated.

The YAML syntax is correct, but ensure that:

  1. Go 1.25.3 is an actual, released version
  2. All other workflow files (e.g., .github/workflows/go.yml mentioned in the enriched summary) are also updated to Go 1.25.3 for consistency

Run this script to verify consistency across all workflow files:

Additionally, search for the latest Go version to confirm 1.25.3 is valid:


🏁 Script executed:

#!/bin/bash
# Description: Check all GitHub Actions workflows for Go version specifications

echo "=== Go version specifications in all workflows ==="
fd -e yml -e yaml . .github/workflows/ -x grep -n "go-version" {} +

echo ""
echo "=== Checking for version inconsistencies ==="
fd -e yml -e yaml . .github/workflows/ -x grep -h "go-version" {} + | sort | uniq -c

Length of output: 1089


🌐 Web query:

What is the latest version of Go and is 1.25.3 a valid release?

💡 Result:

The latest stable Go release (as of Nov 6, 2025) is go1.25.3 (released October 13, 2025). Yes — 1.25.3 is an official valid release. [1][2]

Sources:
[1] go.dev VERSION (go1.25.3, time 2025-10-13).
[2] Go release history / release notes (go1.25.3 released 2025-10-13).


Update go-ossf-slsa3-publish.yml to use Go 1.25.3 for consistency across workflows.

Go 1.25.3 is a valid release (released October 13, 2025), confirming the version choice is sound. However, the PR is incomplete: .github/workflows/go-ossf-slsa3-publish.yml at line 34 still specifies go-version: 1.17, while release.yml and go.yml have been updated to 1.25.3. This inconsistency should be resolved by updating that file to match the others.

🤖 Prompt for AI Agents
In .github/workflows/go-ossf-slsa3-publish.yml around line 34, the job still
pins go-version: 1.17 while release.yml and go.yml use 1.25.3; update that
go-version value to 1.25.3 so all workflow files consistently use Go 1.25.3,
then run a quick CI/lint check to ensure the workflow YAML remains valid.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
cmd/kes/main.go (2)

234-239: Set a minimum TLS version for the client configuration.

The TLS configuration lacks a minimum version constraint. Consider adding MinVersion: tls.VersionTLS13 (or tls.VersionTLS12 for broader compatibility) to align with the TLS hardening applied elsewhere in this PR.

As per static analysis hints.

Apply this diff:

 client := kes.NewClientWithConfig("", &tls.Config{
+	MinVersion: tls.VersionTLS13,
 	GetClientCertificate: func(*tls.CertificateRequestInfo) (*tls.Certificate, error) {
 		return &cert, nil
 	},
 	InsecureSkipVerify: false,
 })

123-130: Remove the unused InsecureSkipVerify field.

The InsecureSkipVerify field in the config struct is no longer used since line 238 now hardcodes this value to false. Remove this field to avoid confusion and maintain a clean API surface.

Apply this diff:

 type config struct {
 	Endpoint           string
 	APIKey             string
 	PrivateKeyFile     string
 	CertificateFile    string
-	InsecureSkipVerify bool
 }
go.mod (1)

3-5: Go version directives not updated to match PR objective.

The PR title states "Set Go version to 1.25.3", but the git diff confirms that go (line 3) and toolchain (line 5) remain unchanged at 1.25.0 and go1.25.1 respectively. Update these lines to 1.25.3 or clarify if the PR objective has changed.

-go 1.25.0
+go 1.25.3

-toolchain go1.25.1
+toolchain go1.25.3
🧹 Nitpick comments (1)
.golangci.yml (1)

5-13: Validate linter availability and revisit the gosec TODO.

The enabled linters (govet, ineffassign, misspell, prealloc, revive, staticcheck, unconvert, unused) should all be available in your golangci-lint version. The TODO comment on line 12 suggests gosec (security linter) was intentionally deferred. If this project handles sensitive operations (cryptography, file I/O, credential handling), consider enabling gosec sooner rather than later to catch security issues early.

Would you like me to help prioritize enabling gosec or flag any specific security concerns that should be addressed?

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5eed726 and 468e14e.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (19)
  • .github/workflows/go.yml (4 hunks)
  • .golangci.yml (1 hunks)
  • cmd/kes/autocomplete.go (1 hunks)
  • cmd/kes/identity.go (5 hunks)
  • cmd/kes/main.go (1 hunks)
  • cmd/kes/migrate.go (0 hunks)
  • cmd/kes/update.go (0 hunks)
  • go.mod (3 hunks)
  • internal/api/api.go (1 hunks)
  • internal/cache/cow.go (1 hunks)
  • internal/keystore/aws/secrets-manager.go (1 hunks)
  • internal/keystore/azure/client.go (2 hunks)
  • internal/keystore/azure/key-vault.go (1 hunks)
  • internal/keystore/fortanix/keystore.go (2 hunks)
  • internal/keystore/gemalto/key-secure.go (1 hunks)
  • internal/keystore/vault/vault.go (3 hunks)
  • kesconf/config.go (1 hunks)
  • kesconf/file.go (2 hunks)
  • server.go (1 hunks)
💤 Files with no reviewable changes (2)
  • cmd/kes/update.go
  • cmd/kes/migrate.go
✅ Files skipped from review due to trivial changes (4)
  • kesconf/config.go
  • cmd/kes/autocomplete.go
  • internal/keystore/aws/secrets-manager.go
  • internal/api/api.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/go.yml
🧰 Additional context used
🧬 Code graph analysis (3)
kesconf/file.go (1)
internal/keystore/efs/efs.go (1)
  • NewStore (35-47)
cmd/kes/main.go (1)
internal/api/api.go (1)
  • InsecureSkipVerify (173-173)
cmd/kes/identity.go (1)
server.go (1)
  • Identity (40-40)
🪛 ast-grep (0.39.7)
cmd/kes/main.go

[warning] 233-238: MinVersionis missing from this TLS configuration. By default, TLS 1.2 is currently used as the minimum when acting as a client, and TLS 1.0 when acting as a server. General purpose web applications should default to TLS 1.3 with all other protocols disabled. Only where it is known that a web server must support legacy clients with unsupported an insecure browsers (such as Internet Explorer 10), it may be necessary to enable TLS 1.0 to provide support. AddMinVersion: tls.VersionTLS13' to the TLS configuration to bump the minimum version to TLS 1.3.
Context: tls.Config{
GetClientCertificate: func(*tls.CertificateRequestInfo) (*tls.Certificate, error) {
return &cert, nil
},
InsecureSkipVerify: false,
}
Note: [CWE-327]: Use of a Broken or Risky Cryptographic Algorithm [OWASP A03:2017]: Sensitive Data Exposure [OWASP A02:2021]: Cryptographic Failures [REFERENCES]
https://owasp.org/Top10/A02_2021-Cryptographic_Failures

(missing-ssl-minversion-go)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build
🔇 Additional comments (19)
internal/cache/cow.go (1)

44-51: LGTM! Improved code clarity with explicit returns.

The conversion from bare returns to explicit returns makes the code more readable and self-documenting. Both returns are functionally equivalent to the previous bare returns but are clearer about what values are being returned.

internal/keystore/vault/vault.go (3)

261-268: LGTM! Clean refactor to wrapper methods.

The changes correctly refactor the Vault API calls to use higher-level client wrapper methods (s.client.NewRequest and s.client.RawRequestWithContext) instead of accessing the nested client. This aligns with the broader wrapper-client usage pattern mentioned in the PR summary and maintains all existing error handling and context propagation.


326-330: LGTM! Consistent refactoring.

The same wrapper method refactoring is correctly applied here in the key creation path, maintaining consistency with the transit encryption changes above.


392-399: LGTM! All refactoring sites updated consistently.

The wrapper method refactoring is applied consistently to the transit decryption path as well. All three locations where raw Vault API requests are made (transit encrypt, key creation, transit decrypt) have been updated uniformly, ensuring no mixing of old and new patterns.

internal/keystore/gemalto/key-secure.go (1)

83-86: LGTM! TLS 1.3 enforcement strengthens security.

The addition of MinVersion: tls.VersionTLS13 aligns with the TLS hardening applied throughout this PR and follows security best practices.

kesconf/file.go (1)

857-860: LGTM! TLS 1.3 enforcement improves security posture.

The TLS configuration now enforces a minimum version of TLS 1.3, consistent with the security hardening applied across keystore implementations in this PR.

server.go (1)

459-464: LGTM! TLS 1.2 minimum is appropriate for the server listener.

Setting MinVersion: tls.VersionTLS12 for the server listener enforces a secure baseline while maintaining reasonable client compatibility. This is consistent with the TLS hardening approach in this PR, where backend keystore connections use TLS 1.3 while the server listener uses TLS 1.2.

internal/keystore/fortanix/keystore.go (2)

86-89: LGTM! TLS 1.3 enforcement strengthens security.

The TLS configuration now enforces TLS 1.3 when custom CAs are provided, aligning with the security hardening implemented across keystore components in this PR.


338-343: LGTM! Improved error handling pattern.

The refactored error handling using the parsed error as the switch expression is cleaner and more readable while maintaining the same functionality.

cmd/kes/identity.go (2)

78-78: LGTM! Alias removal improves code clarity.

The changes consistently reference the kes package directly instead of using an alias, improving code readability.

Also applies to: 109-109, 124-124, 149-149


332-332: Certificate file permission is more restrictive than typical.

The certificate file is now created with 0600 permissions instead of the typical 0644. While certificates are generally public and don't require such restrictive permissions, using 0600 provides consistency with the private key permissions and aligns with security frameworks that require restricted permissions on all TLS-related files. This change is acceptable and defensively sound.

internal/keystore/azure/client.go (1)

169-169: LGTM! Consistent with Azure SDK API updates.

Both changes correctly switch to accessing page.Value directly. The length check at line 169 and the iteration at line 180 are safe—Go handles len() on nil slices (returns 0) and ranging over nil slices gracefully. This is consistent with the changes in key-vault.go.

Also applies to: 180-180

internal/keystore/azure/key-vault.go (1)

301-301: API change is correct and verified.

The Azure SDK version v1.4.0 is in use. The code correctly uses page.Value at three locations (key-vault.go:301, client.go:169, and client.go:180), all consistent with the paging API. page.Value is the pager wrapper's field that exposes the service response items via the pager API—this is the standard pattern in the Azure SDK for Go. The implementation is safe; ranging over a nil slice is valid in Go.

go.mod (2)

36-36: Verify indirect dependency chain stability.

Several indirect dependencies have been updated, including AWS SDK transitive dependencies (imds, configsources, endpoints, ini, accept-encoding, presigned-url, sso, ssooidc, sts), go-jose, Google protobuf APIs, and x/* stdlib packages. Confirm that the transitive dependency chain is stable and that these updates don't introduce breaking changes or version conflicts.

Also applies to: 43-51, 61-61, 98-99, 102-103, 105-106


9-9: Verify Azure SDK version and check for known vulnerabilities in dependency updates.

This PR updates several core packages. While Google Cloud secretmanager Go SDK v1.16.0 has no published security advisories, you should verify:

  1. Azure SDK compatibility: Azure SDK's azidentity package had CVE-2024-35255 (elevation-of-privilege) that was patched in versions >= 1.6.0. Confirm the azidentity version is being updated to a patched release if included in this PR.

  2. AWS SDK: No major AWS SDK for Go v2 CVEs reported in 2025, but monitor transitive dependencies.

  3. Transitive dependencies: Review the updated dependency tree for other ecosystem CVEs (e.g., golang-jwt).

Run go mod graph and cross-reference updated versions against GitHub Advisory Database and NVD to confirm no vulnerable versions are introduced.

.golangci.yml (4)

1-3: Verify golangci-lint version compatibility with config v2.

The migration from the implicit disable-all model to explicit version: "2" with default: none is architecturally sound. However, this requires a minimum version of golangci-lint. Ensure your CI pipeline specifies a compatible golangci-lint version (v1.50.0+) that supports config v2.

Please verify the golangci-lint version pinned in your CI configuration matches the requirements for config v2.


14-21: Confirm staticcheck exclusions are justified.

The staticcheck configuration excludes SA1019 (deprecated package use) and ST1000 (package comment formatting). Excluding SA1019 will hide warnings about deprecated APIs, which could lead to technical debt. Consider documenting why these are excluded or revisit this decision periodically.

Verify that the exclusion of SA1019 and ST1000 is intentional and well-documented.


35-44: Formatters configuration is consistent with linters.

Both gofumpt and goimports are enabled with matching path-based exclusions (third_party, builtin, examples). This is appropriate to keep generated and vendored code unmodified by formatters.


22-34: Exclusion rule patterns are partially verified; manual testing recommended for var-naming and exitAfterDefer.

The exclusion rules framework is confirmed working: the package-comments rule successfully skipped 20 issues. Text patterns in golangci-lint are treated as regular expressions and matched as substrings by default, so the configured patterns don't require exact full matches.

However, verification limitations prevent confirming whether var-naming and exitAfterDefer patterns match current linter output:

  • package-comments: Confirmed working (20 issues skipped by rule)
  • var-naming: Revive var-naming produces variable-specific messages like "var customVm should be customVM" or "don't use underscores in Go names" formats. The configured pattern "var-naming: don't use ALL_CAPS in Go names; use CamelCase" appears to be one message variant, but cannot be confirmed without actual violations.
  • exitAfterDefer: This message comes from the go-critic linter, not revive. The pattern "exitAfterDefer:" is a simple substring that should match, but requires violations to verify.

Recommend enabling these linters and checking sample violations to confirm text patterns match actual output before relying on them for exclusions.

@franchb
franchb merged commit 8e94e43 into master Nov 6, 2025
8 checks passed
@franchb
franchb deleted the franchb-patch-1 branch November 6, 2025 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant